package com.freedom.admin.infrastructure.persistence.repository;

import com.freedom.admin.domain.repository.OauthClientRepository;
import com.freedom.admin.infrastructure.persistence.assembler.OauthClientAssembler;
import com.freedom.admin.infrastructure.persistence.mapper.SysOauthClientMapper;
import com.freedom.admin.infrastructure.persistence.pojo.bo.OauthClientBO;
import com.freedom.admin.infrastructure.persistence.pojo.po.SysOauthClientPO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class OauthClientRepositoryImpl implements OauthClientRepository {

    private final SysOauthClientMapper sysOauthClientMapper;

    private final OauthClientAssembler oauthClientAssembler;

    @Override
    public OauthClientBO findOauthClientById(String clientId) {
        SysOauthClientPO sysOauthClientPO = sysOauthClientMapper.selectByClientId(clientId);
        return oauthClientAssembler.toBO(sysOauthClientPO);
    }
}
